xen: credit2: when tickling, check idle cpus first
authorDario Faggioli <dario.faggioli@citrix.com>
Wed, 6 Jul 2016 16:34:14 +0000 (17:34 +0100)
committerGeorge Dunlap <george.dunlap@citrix.com>
Fri, 8 Jul 2016 10:04:48 +0000 (11:04 +0100)
commite4c1792b589be236d68eb7930979cadb5838e097
treece6d800b344c7a4b91c28308fa63c59f8bfbbe09
parent699afce62e772e6bdf1e1565761cf6955bfa1cce
xen: credit2: when tickling, check idle cpus first

If there are idle pCPUs, it's always better to try to
"ship" the new vCPU there, instead than letting it
preempting on a currently busy one.

This commit also adds a cpumask_test_or_cycle() helper
function, to make it easier to code the preference for
the pCPU where the vCPU was running before.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/common/sched_credit2.c
xen/include/xen/cpumask.h